import { BaseShape } from './BaseShape';
import { IType } from './IShape';

export class ImageShape extends BaseShape {
  /* 原图，需要存储到服务器上 */
  src: string;

  /* 是否抖动[请求] */
  keep: boolean;

  /* 是否转黑白[请求/本地] */
  bw: boolean;

  /* 临时缓存，用于显示抖动等效果 */
  cacheSrc: string;

  rotate: number;

  constructor() {
    super(IType.IMAGE);
    this.src = '';
    this.keep = false;
    this.bw = false;
    this.cacheSrc = '';
    this.w = 60;
    this.h = 60;
    // this.minWidth = 10;
    this.rotate = 0;
    // this.minHeight = 10;
    this.icon = 'image-alt';
  }
}

export class DImageShape extends ImageShape {
  constructor() {
    super();
    this.type = IType.DIMAGE;
  }
}
